package com.hebeiwangxiaozhang.user.service.repo;

import com.hebeiwangxiaozhang.user.service.pojo.OauthClient;
import com.hebeiwangxiaozhang.user.service.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface OauthClientRepository extends JpaRepository<OauthClient, Integer> {
    OauthClient findByClientId(String clientId);

    @Query(value = "update oauth_client_details set client_secret=?1  where client_id=?2", nativeQuery = true)
    @Modifying
    @Transactional
    public void updateSecretByPhoneNumber(String secret, String phoneNumber);
}